/*
 *
 *  * Copyright 1999-2017 esfak47
 *  *
 *  * Licensed under the Apache License, Version 2.0 (the "License");
 *  * you may not use this file except in compliance with the License.
 *  * You may obtain a copy of the License at
 *  *
 *  *      http://www.apache.org/licenses/LICENSE-2.0
 *  *
 *  * Unless required by applicable law or agreed to in writing, software
 *  * distributed under the License is distributed on an "AS IS" BASIS,
 *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  * See the License for the specific language governing permissions and
 *  * limitations under the License.
 *
 */

package com.esfak47.spring.boot.stater.avcloud.service;

import com.avos.avoscloud.AVException;
import com.avos.avoscloud.callback.AVServerDateCallback;
import com.avos.avoscloud.internal.InternalDate;
import com.avos.avoscloud.internal.InternalSMS;

import java.util.Date;
import java.util.Map;

/**
 * @author Tony
 * Created by tony on 2018/1/8.
 */
public class AVCloudServiceImpl implements AVCloudService {

    @Override
    public void requestSMSCode(String phone, String name, String op, int ttl) throws AVException {
        InternalSMS.requestSMSCode(phone, name, op, ttl);
    }

    @Override
    public void requestSMSCode(String phone, String templateName, Map<String, Object> env) throws AVException {
        InternalSMS.requestSMSCode(phone, templateName, env);
    }

    @Override
    public void requestSMSCode(String phone) throws AVException {
        InternalSMS.requestSMSCode(phone, (String) null, (String) null, 0);
    }

    @Override
    public void requestVoiceCode(String phoneNumber) throws AVException {
        InternalSMS.requestVoiceCode(phoneNumber, (String) null);
    }

    @Override
    public void verifySMSCode(String code, String mobilePhoneNumber) throws AVException {
        InternalSMS.verifySMSCode(code, mobilePhoneNumber);
    }

    @Override
    public void verifyCode(String code, String mobilePhoneNumber) throws AVException {
        InternalSMS.verifySMSCode(code, mobilePhoneNumber);
    }

    @Override
    public Date getServerDate() throws AVException {
        return InternalDate.getServerDate();
    }

    @Override
    public void getServerDateInBackground(AVServerDateCallback callback) {
        InternalDate.getServerDateInBackground(callback);
    }
}
